//路由文件
import Vue from "vue"
import Router from "vue-router"
//引入组件
import login from "../components/login/login.vue"
import user from "../components/login/register.vue"
import picbookList from "../components/picbookList/list.vue"
import recommendList from "../components/picbookList/recommend.vue"
import details from "../components/picbookList/details.vue"
import picbook from "../components/picbook/picbook.vue"
import score from "../components/picbook/score.vue"
import recommend from "../components/picbook/recommend.vue"
import activity from "../components/picbookList/activity.vue"
import assignment from "../components/assignment/picbook.vue"
import study from "../components/personal/study.vue"
import community from "../components/community/community.vue"
import communityPicbook from "../components/community/picbook.vue"
import personalProduce from "../components/personal/produce.vue"
import personal from "../components/personal/personal.vue"
import personalMenu from "../components/personal/menu.vue"
import personalInformation from "../components/personal/information.vue"
import personalRead from "../components/personal/read.vue"
import produce from "../components/produce/produce.vue"
Vue.use(Router)

export default new Router({
    routes: [
        { path: '/', redirect: 'login' },
        { path: "/login", component: login },
        { path: "/user", component: user, meta: { requireAuth: true } },
        { path: "/picbookList", component: picbookList, meta: { requireAuth: true } },
        { path: "/details", component: details, meta: { requireAuth: true } },
        { path: "/recommendList", component: recommendList, meta: { requireAuth: true } },
        { path: "/picbook", component: picbook, meta: { requireAuth: true }, },
        { path: "/score", component: score, meta: { requireAuth: true }, },
        { path: "/recommend", component: recommend, meta: { requireAuth: true }, },
        { path: "/activity", component: activity, meta: { requireAuth: true }, },
        { path: "/assignment", component: assignment, meta: { requireAuth: true } },
        { path: "/study", component: study, meta: { requireAuth: true } },
        { path: "/produce", component: produce, meta: { requireAuth: true } },
        { path: "/community", component: community, meta: { requireAuth: true } },
        { path: "/communityPicbook", component: communityPicbook, meta: { requireAuth: true } },
        {
            path: "/personal",
            component: personal,
            meta: { requireAuth: true },
            children: [
                { path: "menu", component: personalMenu, meta: { requireAuth: true } },                     //个人中心
                { path: "information", component: personalInformation, meta: { requireAuth: true } },       //个人信息
                { path: "read", component: personalRead, meta: { requireAuth: true } },                     //历史记录
                { path: "produce", component: personalProduce, meta: { requireAuth: true } },
                { path: "study", component: study, meta: { requireAuth: true } }
            ]
        }
    ]
})
